/*
 * @Author: Sam
 * @Date: 2020-11-19 09:59:21
 * @LastEditTime: 2021-11-04 15:38:34
 * @LastEditors: Sam
 * @Description:
 * @FilePath: \resourcesf:\thework\tofba-client\src\api\abroadWaybill.js
 * @可以输入预定的版权声明、个性签名、空行等
 */
import request from '@/utils/request'
import { getToken } from '@/utils/auth'

// 初始化页面
export function initAbroadWaybillRender (data) {
  return request({
    url: '/abroad/waybills/initAbroadWaybillRender',
    method: 'post',
    data
  })
}

// 海外仓运单信息
// 新增/保存运单
export function saveAbroadWaybill (data) {
  return request({
    url: '/abroad/waybills/saveAbroadWaybill',
    method: 'post',
    data
  })
}
// 运单列表
export function abroadWaybillList (data) {
  return request({
    url: '/abroad/waybills/list',
    method: 'post',
    data
  })
}
// 打回待确认
export function callbackConfirmWaybill (data) {
  return request({
    url: '/abroad/waybills/callbackConfirmWaybill',
    method: 'post',
    params: data
  })
}
// 确认运单
export function confirmAbroadWaybill (data) {
  return request({
    url: '/abroad/waybills/confirmAbroadWaybill',
    method: 'post',
    params: data
  })
}
// 删除运单
export function deleteAbroadWaybillById (data) {
  return request({
    url: '/abroad/waybills/deleteAbroadWaybillById',
    method: 'post',
    params: data
  })
}
// 保存运单基本信息和货物信息
export function saveAbroadWaybillOrGoodsInfos (data) {
  return request({
    url: '/abroad/waybills/saveAbroadWaybillOrGoodsInfos',
    method: 'post',
    params: data
  })
}

// 查询运单信息
export function getAbroadWaybillById (data) {
  return request({
    url: '/abroad/waybills/getAbroadWaybillById',
    method: 'post',
    params: data
  })
}

// 确认箱单信息
export function updateAbroadConfirmFlag (data) {
  return request({
    url: '/abroad/waybills/updateAbroadConfirmFlag',
    method: 'post',
    params: data
  })
}

/**
 *  货物信息
 */
// 导入货物信息
export function batchUploadGoodsInfoData (data) {
  return request({
    url: '/abroad/waybills/batchUploadGoodsInfoData',
    method: 'post',
    params: data
  })
}
// 导出货物信息
export function downLoadGoodsInfo (data) {
  return request({
    url: '/abroad/waybills/downLoadGoodsInfo',
    method: 'post',
    params: data
  })
}
// 货物信息批量保存
export function batchUpdateGoodsInfo (data) {
  return request({
    url: '/abroad/waybills/batchUpdateGoodsInfo',
    method: 'post',
    params: data
  })
}
// 货物信息批量保存
export function batchSaveOrUpdateGoodsInfo (data) {
  return request({
    url: '/abroad/waybills/batchSaveOrUpdateGoodsInfo',
    method: 'post',
    data
  })
}
// 通过运单id查询货物信息
export function getGoodsInfoByWaybillId (data) {
  return request({
    url: '/abroad/waybills/getGoodsInfoByWaybillId',
    method: 'post',
    data
  })
}

/**
 *  发货跟踪信息
 */
// 查询发货跟踪信息(运单ID)
export function queryAbroadTrackAddresslist (data) {
  return request({
    url: '/abroad/waybills/queryAbroadTrackAddresslist',
    method: 'post',
    data
  })
}
// 新增或者修改发货跟踪信息)
export function saveOrUpdateAbroadTrackAddress (data) {
  return request({
    url: '/abroad/waybills/saveOrUpdateAbroadTrackAddress',
    method: 'post',
    params: data
  })
}
// 批量保存发货跟踪信息
export function batchSaveAbroadTrackAddress (data) {
  return request({
    url: '/abroad/waybills/batchSaveAbroadTrackAddress',
    method: 'post',
    data
  })
}

/**
 *  操作指令信息
 */

// 导入操作指令信息
export function uploadOperationInstruct (data) {
  return request({
    url: '/abroad/waybills/uploadOperationInstruct',
    method: 'post',
    params: data
  })
}
// 导出操作指令信息
export function downLoadInstruction (data) {
  return request({
    url: '/abroad/waybills/downLoadInstruction',
    method: 'post',
    data
  })
}

// 上传海外仓运单标签
export function uploadAbroadWaybillLabelFile (data) {
  return request({
    url: '/abroad/waybills/uploadAbroadWaybillLabelFile',
    method: 'post',
    params: data
  })
}
// 查询操作指令信息
export function queryByWaybillId (data) {
  return request({
    url: '/abroad/waybills/queryByWaybillId',
    method: 'post',
    params: data
  })
}
// 查询操作指令信息
export function queryAbroadOperationByWaybillId (data) {
  return request({
    url: '/abroad/waybills/queryAbroadOperationByWaybillId',
    method: 'post',
    data
  })
}
// 操作指令信息批量保存
export function updateOperationInstruct (data) {
  return request({
    url: '/abroad/waybills/updateOperationInstruct',
    method: 'post',
    data
  })
}
// 查询最大操作批次
export function queryReturnBatchCountById (data) {
  return request({
    url: '/abroad/waybills/queryReturnBatchCountById',
    method: 'post',
    data
  })
}
// 新增操作批次
export function saveReturnBatch (data) {
  return request({
    url: '/abroad/waybills/saveReturnBatch',
    method: 'post',
    data
  })
}

/**
 * @description: 文件列表
 */

//  通过ID查询
export function findWaybillFileById (data) {
  return request({
    url: '/abroad/waybill/findWaybillFileById',
    method: 'post',
    data
  })
}

// 查询文件列表
export function queryWaybillFileList (data) {
  return request({
    url: '/abroad/waybills/queryWaybillFileList',
    method: 'post',
    data
  })
}

// 箱单信息

// 导入箱单信息
export function batchUploadAbroadPackList (data) {
  return request({
    url: '/abroad/waybills/batchUploadAbroadPackList',
    method: 'post',
    params: data
  })
}
// 导出箱单信息
export function downloadAbroadPackList (data) {
  return request({
    url: '/abroad/waybills/downloadAbroadPackList',
    method: 'post',
    data
  })
}
// 查询箱单信息(运单ID)
export function queryAbroadPackingByWaybillId (data) {
  return request({
    url: '/abroad/waybills/queryAbroadPackingByWaybillId',
    method: 'post',
    data
  })
}
// 保存箱单信息
export function saveAbroadPacking (data) {
  return request({
    url: '/abroad/waybills/saveAbroadPacking',
    method: 'post',
    data
  })
}

//
// 退货追踪信息
// 导出退货追踪信息
export function downLoadReturnTrack (data) {
  return request({
    url: '/abroad/waybills/downLoadReturnTrack',
    method: 'post',
    data
  })
}

// 删除退货跟踪信息
export function deleteReturnTracking (data) {
  return request({
    url: '/abroad/waybills/deleteReturnTracking',
    method: 'post',
    params: data
  })
}
// 导入退货追踪信息
export function batchUploadReturnTrackData (data) {
  return request({
    url: '/abroad/waybills/batchUploadReturnTrackData',
    method: 'post',
    params: data
  })
}
// 退货追踪信息
export function queryAbroadReturnReceiveGoodsByWaybillId (data) {
  return request({
    url: '/abroad/waybills/queryAbroadReturnReceiveGoodsByWaybillId',
    method: 'post',
    data
  })
}
// 保存退货追踪信息
export function batchUpdateReturnReceiveGoods (data) {
  return request({
    url: '/abroad/waybills/batchUpdateReturnReceiveGoods',
    method: 'post',
    data
  })
}

/**
 * @description: 进度条
 */
//  获取进度条状态
export function initAbroadWaybillState (data) {
  return request({
    url: '/abroad/waybill/initAbroadWaybillState',
    method: 'post',
    data
  })
}
//  保存进度条状态
export function saveAbroadWaybillStateLine (data) {
  return request({
    url: '/abroad/waybill/saveAbroadWaybillStateLine',
    method: 'post',
    data
  })
}
//  查询应收应收
export function queryAbroadPaymentReceivable (data) {
  return request({
    url: '/abroad/waybills/queryAbroadPaymentReceivable',
    method: 'post',
    params: data
  })
}
// 确认账单信息
export function confirmAbroadBillStatus (data) {
  return request({
    url: '/abroad/waybills/confirmAbroadBillStatus',
    method: 'post',
    params: data
  })
}
// 删除附件信息
export function deleteWaybillFile (data) {
  return request({
    url: '/abroad/waybills/deleteWaybillFile',
    method: 'post',
    data
  })
}
// 获取库存信息
export function getAbroadStockGoodsWaybillId (data) {
  return request({
    url: '/abroad/waybills/getAbroadStockGoodsWaybillId',
    method: 'post',
    data
  })
}
// 批量选择退货追踪修改退货追踪以及库存信息
export function batchUpdateReturnTrackOrStockGoods (data) {
  return request({
    url: '/abroad/waybills/batchUpdateReturnTrackOrStockGoods',
    method: 'post',
    data
  })
}
// 箱单删除
export function deletePackingList (data) {
  return request({
    url: '/abroad/waybills/deletePackingList',
    method: 'post',
    data
  })
}
// 操作指令删除
export function deleteOperationInstruct (data) {
  return request({
    url: '/abroad/waybills/deleteOperationInstruct  ',
    method: 'post',
    data
  })
}
// 导出库存
export function exportStockGoods (data) {
  return request({
    url: '/abroad/waybills/exportStockGoods  ',
    method: 'post',
    data
  })
}
// 批量删除退货跟踪信息
export function batchDeleteReturnReceive (data) {
  return request({
    url: '/abroad/waybills/batchDeleteReturnReceive',
    method: 'post',
    data
  })
}
// 删除退货跟踪信息
export function deleteAbroadSku (data) {
  return request({
    url: '/abroad/waybills/deleteAbroadSku',
    method: 'post',
    data
  })
}
